#ifndef	ERROR_H_
#define	ERROR_H_

#define OK			1
#define	NOT_OK		-1

/**
 ** Prints an error message according to the error opcode.
 **
 **	@param	code	Error opcode.
 **
 **/
void print_error(short code);

/* Error opcode definitions */
enum
{
	ERROR_WRONG_LOGIN = 1, ERROR_NEED_LOGIN,
	ERROR_FILE_NOT_EXISTS, ERROR_ALLRDY_DOWNLADING,
	ERROR_NO_TICKETS_LEFT, ERROR_TICKET_NOT_EXISTS, ERROR_TICKET_LOST,
	ERROR_TICKET_NA, ERROR_TICKET_EXPIRED,
	ERROR_UPLOAD_NO_SPACE, ERROR_UPLOAD_FILE_EXISTS,
	ERROR_UPLOAD_INVALID_FILENAME,
	ERROR_MAX_CONN_REACHED,
	ERROR_SERVER_CRITIC, ERROR_SERVER_FATAL, ERROR_CONNECTION_FAILURE,
	ERROR_OPCODE_CONFLICT,
	ERROR_LIST_NO_CAT, ERROR_LIST_NO_FILES, ERROR_LIST_NO_USERS,
	ERROR_TIME_OUT
};


#endif
